<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
		<style>
			
		</style>
		<script>
			// 找到符合条件的一项 find
			let arr = [1,2,3,4];
			// 找到数组中小于的3的第一项
			let f = arr.find(item => item < 3);
			let fIndex = arr.findIndex(item => item < 3);
			console.log(f,fIndex);

			let o = [{age:30},{age:40},{age:50}];
			let age = o.find(item => item.age === 90);
			let ageIndex = o.findIndex(item => item.age === 90);
			console.log(age,ageIndex);
		</script>
	</head>

	<body>
		
	</body>
</html>